/*
 * mex_main.h
 *
 *  Created on: 17/01/2012
 *      Author: will
 */

#ifndef MEX_MAIN_H_
#define MEX_MAIN_H_

#include "catgraph/CatGraph.h"

// check argument definitions

void checkArgs_deserializeGraph(int *nrhs, const mxArray **prhs);
void checkArgs_serializeGraph(int *nrhs, const mxArray **prhs);
void checkArgs_initialiseGraph(int *nrhs, const mxArray **prhs);
void checkArgs_initialiseTrajectory(int *nrhs, const mxArray **prhs);
void checkArgs_initialiseVision(int *nrhs, const mxArray **prhs);
void checkArgs_initialiseParticles(int *nrhs, const mxArray **prhs);
void checkArgs_addNode(int *nrhs, const mxArray **prhs);
void checkArgs_updateInformation(int *nrhs, const mxArray **prhs);
void checkArgs_updateInformationOnline(int *nrhs, const mxArray **prhs);
void checkArgs_pruneNode(int *nrhs, const mxArray **prhs);
void checkArgs_pruneNodeOnline(int *nrhs, const mxArray **prhs);
void checkArgs_updateParticlePositions(int *nrhs, const mxArray **prhs);
void checkArgs_updateParticleWeights(int *nrhs, const mxArray **prhs);
void checkArgs_updateParticleWeightsOnline(int *nrhs, const mxArray **prhs);
void checkArgs_calculateESS(int *nrhs, const mxArray **prhs);
void checkArgs_calculateHypothesis(int *nrhs, const mxArray **prhs);
void checkArgs_addLoopClosure(int *nrhs, const mxArray **prhs);
void checkArgs_resampleParticles(int *nrhs, const mxArray **prhs);
void checkArgs_buildCodebookFromMap(int *nrhs, const mxArray **prhs);
void checkArgs_buildChowLiuFromMap(int *nrhs, const mxArray **prhs);
void checkArgs_recomputeWords(int *nrhs, const mxArray **prhs);
void checkArgs_recomputeInformation(int *nrhs, const mxArray **prhs);
void checkArgs_outputLocalGraph(int *nrhs, const mxArray **prhs);
void checkArgs_outputLocalHypothesis(int *nrhs, const mxArray **prhs);
void checkArgs_printNodes(int *nrhs, const mxArray **prhs);
void checkArgs_printEdges(int *nrhs, const mxArray **prhs);
void checkArgs_printParticles(int *nrhs, const mxArray **prhs);
void checkArgs_printLocalGraph(int *nrhs, const mxArray **prhs);
void checkArgs_printInformation(int *nrhs, const mxArray **prhs);
void checkArgs_outputLocalUpdate(int *nrhs, const mxArray **prhs);
void checkArgs_outputNodes(int *nrhs, const mxArray **prhs);
void checkArgs_outputEdges(int *nrhs, const mxArray **prhs);
void checkArgs_outputParticles(int *nrhs, const mxArray **prhs);
void checkArgs_outputPlan(int *nrhs, const mxArray **prhs);

// function definitions

CatGraph* deserializeGraph(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void serializeGraph(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
CatGraph* initialiseGraph(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void initialiseVision(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void initialiseTrajectory(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void initialiseParticles(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void addNode(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void updateInformation(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void updateInformationOnline(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void pruneNode(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void pruneNodeOnline(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void updateParticlePositions(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void updateParticleWeights(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void updateParticleWeightsOnline(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void calculateESS(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void calculateHypothesis(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void addLoopClosure(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void resampleParticles(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void buildCodebookFromMap(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void buildChowLiuFromMap(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void recomputeWords(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void recomputeInformation(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputLocalGraph(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputLocalHypothesis(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void printNodes(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void printEdges(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void printParticles(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void printLocalGraph(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void printInformation(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputLocalUpdate(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputNodes(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputEdges(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputParticles(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);
void outputPlan(mxArray **plhs, const mxArray **prhs, CatGraph *catGraph);


#endif /* MEX_MAIN_H_ */
